
#ifndef IWUI_CONTACTS_H
#define IWUI_CONTACTS_H

// Standard includes

#include "s3eTypes.h"
// Forward declarations
class CIwUIElement;

// Typedefs
typedef char DailyReportField[0x100];




//-----------------------------------------------------------------------------

class IDailyReportsItemSource
{
public:
    // Public interface
    virtual int32 GetRowIdByIndex(int32 pRowindex) = 0;
    virtual int CreateItem(const char* pTaskName, const char* pBeginDate, const char* pStartTime, const char* pEndTime, int pDuration) = 0;
    virtual void UpdateItemByRowId(int32 pRowId, const char* pTaskName, const char* pBeginDate, const char* pStartTime, const char* pEndTime, const char* pDes) = 0;
    virtual void UpdateDoneByRowId(int32 pRowId, char* pEndDate, char* pEndTime) = 0;
    virtual void UpdateDurationByRowId(int pIncrement) = 0;
    virtual void DeleteItemByRowId(int32 pRowId) = 0;
    virtual void UpdateAllItem() = 0;
	virtual void GetDataById(int pRowId, char* pTaskName, char* pBeginDate, char* pStartTime, char* pEndTime, char* pDes) = 0;
};


class CIwUIDailyReport
{
public:
	
	//enum LocaliseLanguages
	//{
	//	LOCALISE_ENGLISH,
	//	LOCALISE_FRENCH,

	//	NUM_LANGUAGES,

	//	DEFAULT_LANGUAGE = LOCALISE_ENGLISH
	//};

	//// Current language
	//LocaliseLanguages g_Localise;

	// String names of languages
	

	CIwUIDailyReport();
	~CIwUIDailyReport();
	void Run();
	
	// Allow app to reference table item source
    void SetActiveItemSource(IDailyReportsItemSource* pItemSource);

    // Reload all dailyReports
    void UpdateAllDailyReports();

    // Create / edit dailyReport dialog
    void ShowCreateDialog(int32 editUID = -1);
    void GetInitialDailyReport(DailyReportField& taskName, DailyReportField& beginDate,
    DailyReportField& startTime, DailyReportField& endTime, DailyReportField& describe) const;
    void CreateConfirmed(const char* pTaskName,
    const char* pBeginDate, const char* pStartTime, const char* pEndTime, const char* pDescribe);
    void HideCreateDialog();

    // Delete dailyReport dialog
    void ShowDeleteDialog(int32 dailyReportIndex);
    void DeleteConfirmed();
    void HideDeleteDialog();



	// ---------------------------------- VNThanh ----------------------------------
	// Create Task
	void CreateTask(CIwUIElement* pCommandElement);
	// Done Task
	void DoneTask(CIwUIElement* pCommandElement);
	// ---------------------------------- End VNThanh ----------------------------------




private:
	void Init();
	void Update(int32 deltaMS);
	void Render();
    

    // Member data
    CIwUIElement*           m_DailyReports;
    CIwUIElement*           m_CreateDialog;
    CIwUIElement*           m_DeleteDialog;

    int32                   m_DeleteRowId;
    int32                   m_EditRowId;
    IDailyReportsItemSource* m_ItemSource;
	
};

// Singleton accessor
CIwUIDailyReport* GetApp();



#endif
